<template>
  <div class="hot">
    <span>热门搜索</span><br />
    <van-row gutter="">
      <van-col span="" v-for="(v, index) in arr" :key="index">{{ v }}</van-col>
    </van-row>
  </div>
</template>

<script>
import axios from "axios";
let service = axios.create();
export default {
  data() {
    return {
      arr: [],
    };
  },
  mounted() {
    service({
      url: "http://118.178.238.19:3001/api/pro/search",
      method: "get",
    }).then((res) => {
      for (let i = 0; i < res.data.data.length; i++) {
        this.arr.push(res.data.data[i].category);
      }
    });
  },
};
</script>

<style scoped>
span {
  color: #999;
}
.hot {
  margin-left: 0.7125rem;
}
.van-col {
  border: 1px solid #999;
  margin: 0.3125rem 0.425rem;
  padding: 0.1875rem 0.3125rem;
}
.van-col:first-child {
  border: 1px solid red;
  color: red;
}
</style>